﻿
using Test30.Engine;
using Test30.Util;

namespace Test30.Data
{
    public class ItemDropParser : DropParser<Item>
    {
        public ItemDropParser(Content content)
        {
            _content = content;
        }

        protected override IDrop<Item> ParseDrop(string text)
        {
            // couldn't find it
            if (!_content.Items.Contains(text)) return null;

            ItemType itemType = _content.Items.Find(text);
            return new ItemDrop(itemType);
        }

        private readonly Content _content;
    }

}
